// MultiInherit.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <iostream.h>

class CA
{
public:
	void setA(int x) { a = x; }
	void printA() { cout << "a =" << a << endl;}

private:
       int a;
};

class CB
{
public:
	void setB(int x) { b = x; }
	void printB() { cout << "b =" << b << endl; }

private:
	int b;
};

class CC : public CA, private CB
{
public:
	void setC(int x, int y, int z)
	{
		setA(x);
		setB(y);
		c = z;
	}

	void printC() { cout << "c =" << c << endl; }

private:
	int c;
};


void main()
{
     CC obj;
     obj.setA(1);
     obj.printA();
     obj.setC(2,3,4);
     obj.printC();
     obj.setB(5); 
     obj.printB(); 
}
